package com.yc.cinema;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
// 扫描该包及其所有子包
@ComponentScan("com.yc.cinema")
public class BeanConfig {

    @Bean("dog1")
    public Dog dog1(){
        Dog dog = new Dog();
        dog.setName("二哈");
        return dog;
    }

    @Bean("cat1")
    public Cat cat1(){
       Cat cat = new Cat();
       cat.setName("狸花猫");
       return cat;
    }


}
